<template>
	<view>
		<view class="w-1 fr-c s-outer" style="background: #FFFFFF;">
			<view class="search-box fr-b-c" style="padding-left: 36rpx; padding-right: 6rpx;">
				<image src="/static/images/user/search_icon.png" style="width: 34rpx; height: 34rpx;"></image>
				<input  type="text" focus placeholder-style="color: #CCCCCC;" v-model="search_keys" confirm-type="search"
					 class="flex-1 s-input" @confirm="getSearch" placeholder="输入想找平台" />
				<view class="fr-c search-btn m-l-20" @click="getSearch">搜索</view>
			</view>
		</view>
		<view class="content3">
			<view class="jiuwu-list-view" v-if="pingtai_list.length >0">
				<view class="jiuwu-list-view-item" v-for="(item,index) in pingtai_list" :key="index" @tap="back(item)">
					<view class="jiuwu-list-view-item-min">
						<image :src="baseUrl.cdnurl+item.avatar" class="jiuwu-list-view-item-min-left" mode=""></image>
						<view class="jiuwu-list-view-item-min-right">
							<view class="jiuwu-list-view-item-min-right-top text-line-1">
								{{item.shopname}}
							</view>
							<view class="jiuwu-list-view-item-min-right-bottom">
								{{item.return}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view style="width: 100%;margin-top: 200rpx;" v-else>
				<u-empty mode="list"></u-empty>
			</view>
			
		</view>
	</view>
</template>

<script>
	import config from '@/utils/base.js';
	export default {
		data() {
			return {
				search_keys:'',
				pingtai_list:[],
				baseUrl:config,
			}
		},
		
		methods: {
			getSearch(e){
			
				this.get_pingtai()
			},
			get_pingtai(){
				let t = this
				t.$api.post({
					url: '/wanlshop/tickets/get_shop_list',
					data:{
						key:t.search_keys
					},
					success: updata => {
						console.log(updata)
						if(updata.code == 1){
							t.pingtai_list = updata.data
						}
					}
				});
			},
			back(item){
				let page = getCurrentPages()
				let curRoute = page[page.length - 2]
				console.log(curRoute)
				curRoute.$vm.picker_val = item
				console.log(curRoute.$vm.picker_val)
				// return false
				uni.navigateBack()
			}
		}
	}
</script>

<style>
.s-outer{
	position: sticky;
	top: 0;
	left: 0;
	z-index: 9999;
	padding: 20rpx 0;
}
.search-box {
	width: 686rpx;
	height: 72rpx;
	background: #FFFFFF;
	border-radius: 36rpx;
	border: 2rpx solid #FA360A;
	margin: auto;
}
.s-input {
		font-size: 26rpx;
		font-family: Alibaba;
		color: #CCCCCC;
		margin-left: 6rpx;
	}
	.search-btn {
			width: 142rpx;
			height: 60rpx;
			background: linear-gradient(246deg, #FA360A 0%, #FA8C0A 100%);
			border-radius: 30rpx 30rpx 30rpx 30rpx;
			font-size: 26rpx;
			font-family: Alibaba;
			color: #FFFFFF;
		}
		.jiuwu-list-view-item:last-child {
			border-bottom: #F4F4F4 solid 0rpx;
		}
		
		.jiuwu-list-view-item {
			/* height: 200rpx; */
			border-bottom: #F4F4F4 solid 2rpx;
			padding-top: 20rpx;
			box-sizing: border-box;
			padding: 30rpx 0;
			box-sizing: border-box;
		}
		
		.jiuwu-list-view-item-top {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 24rpx;
			font-family: Alibaba PuHuiTi 2.0-55 Regular, Alibaba PuHuiTi 20;
			font-weight: normal;
			color: #666666;
		}
		
		.jiuwu-list-view-item-min-left {
			min-width: 116rpx;
			width: 116rpx;
			height: 116rpx;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			opacity: 1;
			border: 2rpx solid #F4F4F4;
			margin-right: 20rpx;
		}
		
		.jiuwu-list-view-item-min {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 12rpx;
		}
		
		.jiuwu-list-view-item-min-right {
			width: 100%;
		}
		
		.jiuwu-list-view-item-min-right-bottom {
			font-size: 24rpx;
			font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
			font-weight: normal;
			color: #E32D1D;
			margin-top: 12rpx;
		}
		
		.jiuwu-list-view-item-min-right-bottom-num {
			font-size: 32rpx;
		}
		.content3{
			padding: 30rpx;
			box-sizing: border-box;
		}
</style>
